package com.sacc.service.Impl;

import com.sacc.mapper.ProductTypeMapper;
import com.sacc.pojo.ProductType;
import com.sacc.service.ProductTypeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;


/**
 * @author 滚~韬
 * @date 2022/4/9 18:08
 */
@Service
public class ProductTypeServiceImpl implements ProductTypeService {
    @Autowired
    private ProductTypeMapper productTypeMapper;

    /**
     * 根据产品id获取产品类别名字
     * @param ProductId
     * @return
     */
    public String GetName(Integer ProductId){
        ProductType productType = productTypeMapper.selectById(ProductId);
        return productType.getProductTypeName();
    }
    public List<ProductType> GetAll(){
        return  productTypeMapper.selectList(null);
    }

}
